<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
  <html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
    <link href="<?=base_url()?>frontend/css/base.css" rel="stylesheet" type="text/css" />
    <link href="<?=base_url()?>frontend/css/form.css" rel="stylesheet" type="text/css" />
    <link href="<?=base_url()?>frontend/css/ui-lightness/jquery-ui-1.8.18.custom.css" rel="stylesheet" type="text/css" />
    <?php if (file_exists(Application::path() .'../css/'. Application::get_called_controller() .'.css')) : ?>
    	<link href="<?=Application::resources() . '/css/'. Application::get_called_controller() .'.css'?>" rel="stylesheet" type="text/css" />
    <?php endif; ?>
    
    <script type="text/javascript" src="<?=base_url()?>frontend/js/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="<?=base_url()?>frontend/js/jquery-ui-1.8.18.custom.min.js"></script>
    <script type="text/javascript" src="<?=base_url()?>frontend/js/app.js"></script>
    
    <?php if (file_exists(Application::path() .'../js/'. Application::get_called_controller() .'.js')) : ?>
    	<script type="text/javascript" src="<?=Application::resources()?>/js/<?=Application::get_called_controller()?>.js"></script>
	    <script type="text/javascript">
		App.controller = '<?=ucfirst(Application::get_called_controller())?>';
		App.method = '<?=Application::get_called_method()?>';
	    
	    jQuery(document).ready(function() {
	        App.run();
	    });
	    </script>
    <?php endif; ?>
    <title>Daruiesc.com</title>
</head>
<body>
<table cellpadding="0" cellspacing="0" class="b-base">
	<tr valign="top">
		<td class="b-base-lmargin"></td>
		<td class="b-base-header">
			<div class="b-base-header-bar">
				<div class="b-base-header-sitename"><a href="<?=Application::url()?>">www.daruiesc.com</a></div>
				<div class="b-base-header-userspace">
					<a href="<?=Application::url()?>users/signup">About</a>
					<?php if (Security_Manager::has_role(Security_Manager::DEFAULT_VISITOR_ROLE)) : ?>
					<a href="<?=Application::url()?>users/logout">Logout</a>
					<div class="b-base-header-userspace-welcome">Welcome <?=Security_Manager::get_visitor()->email?></div>
					<?php else : ?>
					<a href="<?=Application::url()?>users/signup">Sign Up</a>
					<form action="<?=Application::url()?>users/do_login" method="POST">
						<input type="text" name="email" style="width: 150px;" />
						<input type="password" name="password" style="width: 100px;" />
						<input type="submit" name="submit" value="Login" />
					</form>
					<?php endif; ?>
				</div>
				<div class="b-clear"></div>
			</div>
			<div class="b-base-header-logo"></div>
		</td>
		<td class="b-base-rmargin"></td>
	</tr>
	<tr valign="top">
		<td class="b-base-lmargin"></td>
		<td class="b-base-body">
			<div class="b-base-content">
				<?php require_once $__layout_page__ . '.php' ?>
				<div>
				<?php foreach ($__messages_error__ as $message) :?>
					<?=$message?>
				<?php endforeach; ?>
				</div>
				
				<div>
				<?php foreach ($__messages_success__ as $message) :?>
					<?=$message?>
				<?php endforeach; ?>
				</div>
			</div>
		</td>
		<td class="b-base-rmargin"></td>
	</tr>
	<tr valign="top">
		<td class="b-base-lmargin"></td>
		<td class="b-base-footer">
			<div class="b-base-footer-bar">
				<a href="<?=Application::url()?>users/signup">About</a>
				<a href="<?=Application::url()?>users/signup">Contacts</a>
				<a href="<?=Application::url()?>users/signup">Project</a>
				<div class="b-base-footer-bar-copyright">Copyright &copy; 2011 - 2012 by daruiesc project team</div>
				<div class="b-clear"></div>
			</div>
		</td>
		<td class="b-base-rmargin"></td>
	</tr>
</table>
<?php show_console()?>
</body>
</html>